
let express = require('express')

let app = express()

app.get('/delay-server', (request, response) => {
    setTimeout(() => {
        response.send('延时服务器发来的数据')
    }, 5000)
})
app.get('/api/index',(request,response)=>{
    response.set('Access-Control-Allow-Origin','*') //允许跨域
    response.send('请求成功')
})
app.listen(9000, () => {
    console.log('启动成功')
})